<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="authMain"/>
        <title>Create User</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="home" controller="auth">Authorize Home</g:link></span>
            <span class="menuButton"><g:link class="list" action="list">User List</g:link></span>
        </div>
        <div class="body">
            <h1>Create User</h1>
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${user}">
                <div class="errors">
                    <g:renderErrors bean="${user}" as="list"/>
                </div>
            </g:hasErrors>
            <g:form action="save" method="post">
                <div class="dialog">
                    <table>
                        <tbody>

                            <tr class='prop'>
                                <td class='name'>Username:</td>
                                <td class="value ${hasErrors(bean: user, field: 'username', 'errors')}">
                                    <input type='text' name='username' class="login" value='${user?.username}'/>
                                </td>
                            </tr>
                            <tr class='prop'>
                                <td class='name'>Password:</td>
                                <td class="value ${hasErrors(bean: request, field: 'password', 'errors')}">
                                    <input type="password" name='password' class="login" value='${request?.password}'/>
                                </td>
                            </tr>
                            <tr class='prop'>
                                <td class='name'>Password Again:</td>
                                <td class="value ${hasErrors(bean: request, field: 'passwordagain', 'errors')}">
                                    <input type="password" name='passwordagain' class="login" value='${request?.passwordagain}'/>
                                </td>
                            </tr>
                            <tr class='prop'>
                                <td class='name'>Email:</td>
                                <td class="value ${hasErrors(bean: user, field: 'email', 'errors')}">
                                    <input type='text' name='email' value='${user?.email}'/>
                                </td>
                            </tr>
                            <tr class='prop'>
                                <td class='name'>First name:</td>
                                <td class="value ${hasErrors(bean: user, field: 'firstname', 'errors')}">
                                    <input type='text' name='firstname' value='${user?.firstname}'/>
                                </td>
                            </tr>
                            <tr class='prop'>
                                <td class='name'>Last name:</td>
                                <td class="value ${hasErrors(bean: user, field: 'lastname', 'errors')}">
                                    <input type='text' name='lastname' value='${user?.lastname}'/>
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create"/></span>
                </div>
            </g:form>
        </div>
    </body>
</html>